//package com.majun.config.filter4;
//
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.filter.CommonsRequestLoggingFilter;
//
//@Configuration
//public class WebFilterConfiguration4 {
//
////    @Bean
////    public FilterRegistrationBean<RequestLogFilter> requestLogFilter (){
////        FilterRegistrationBean<RequestLogFilter> registrationBean = new FilterRegistrationBean<>();
////        registrationBean.setFilter(new RequestLogFilter());
////        // 拦截 "/api" 开头的请求
////        registrationBean.addUrlPatterns("/*");
////        // 执行顺序最靠前
//////        registrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
////        registrationBean.setOrder(Ordered.LOWEST_PRECEDENCE);
////        return registrationBean;
////    }
//
//    @Bean
//    public FilterRegistrationBean logFilterRegistration() {
//        CommonsRequestLoggingFilter filter = new MyRequestLoggingFilter();
//        filter.setIncludeQueryString(true);
//        filter.setIncludePayload(true);
//        filter.setIncludeClientInfo(true);
//        filter.setMaxPayloadLength(256);
//        FilterRegistrationBean registration = new FilterRegistrationBean(filter);
//        registration.addUrlPatterns("/*");
//        registration.setName("commonsRequestLoggingFilter");
//        return registration;
//    }
//}